<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta content="text/html; charset=ISO-8859-1"
          http-equiv="content-type">
    <title>Graph</title>
</head>
<body>

<table bgcolor="maroon" border="1" width="95%">
    <tr>
        <td height="28">
            <h2><font color="#FFFFFF">SEM Graph </font></h2></td>
    </tr>
</table>

<p>This is a specialized type of graph used for specifying the graphical structure of structural equation models (SEMs).
    The causal structure of the graph is indicated using directed edges (--&gt;), and correlated twoCycleErrors are
    indicated using bidirected edges (&lt;-&gt;). Cycles are permitted..</p>
<p>Structurally, between any two variables in the graph X and Y, up to three different edges may be added to the graph:
    X--&gt;Y, X&lt;--Y, and X&lt;-&gt;Y. </p>
<p>To construct a SEM graph, place a Graph box on the workbench (see <a href="../../graph/graphs.html">Graphs</a>),
    double click the Graph box, choose &quot;General Graph&quot; from the menu, and click &quot;OK.&quot; You will see
    the following dialog.</p>
<p><img height="328" src="../../images/graph1structureeditor.gif" width="283"><br>
    <br>
    If you select &quot;Created manually&quot; and click &quot;OK,&quot; a blank graph editor window is opened. If you
    select &quot;A random DAG,&quot; you will need to fill in parameters to generate a random DAG. See <a
            href="../../graph/generating_random_dags.html">Generating Random DAGs</a> for more information. This DAG
    will be treated like a general graph, so that if you edit it you will be able add edges to it that aren't directed
    edges (--&gt;) and you will be able to construct cycles. </p>
<p>You may at this point add variables and edges to the graph, or remove them if they're already there. To add a
    measured variable to the graph, click &quot;Add Variable&quot; and then click in the white workbench area where you
    want the measured variable to be located. To add a latent variable to the graph, click &quot;Add Latent&quot; and
    then click in the white workbench area where you want the latent variable to be located. The names of an added
    variable will be the first name in the sequence X1, X2, ..., that's not already in the graph. These names may be
    changed; see <a href="../../graph/advise_editing_node_properties.html">Editing Node Properties</a> for details. </p>
<p>To remove a variable from the graph, click on the variable you want to delete to select it and then press the delete
    key. If you remove a node from the graph, all of the edges attached to it will be removed as well. </p>
<p>To add an edge to the graph, click the type of edge you want to add, click and hold the mouse button down over the
    variable you want to edge to be from, and then drag the mouse to the variable you want the edge to be to. There are
    four types of edges you may add: directed (--&gt;), undirected (---), unoriented (o-o), and bidirected (o-&gt;).
    Cycles are permitted. </p>
<p>To remove an edge from the graph, click on the edge you want to remove to select it and then press the delete
    key. </p>
<p>If all you want to do is turn edges that aren't directed into directed edges or change the directions of directed
    edges, there is a shortcut way to do this. Simply click on the endpoint of the edge you want the arrow to be on, and
    the edge will change direction for you. Other edge orientation shortchuts are also available. See <a
            href="../../graph/edge_orientation_shortchuts.html">Edge Orientation Shortcuts</a>.</p>
<p>A sample graph might look like this:</p>
<p><img height="575" src="../../images/sem_graph1.gif" width="564"></p>
<p>The interpretion is that X5 causes X1, X1 causes X3, X2 causes X3, there is a feedback loop between X3 and X4, and
    the error terms for X5 and X1 are correlated. Each variable in a SEM Graph is associated implicitly with an error
    term (see Stuctural Equation Models). To show the error terms for the endogenous terms, select &quot;Show Error
    Terms&quot; from the Tools menu.</p>
<p><img height="576" src="../../images/sem_graph2.gif" width="562"></p>
<p>Notice that any bidirected edges are adjusted so that they attach only to exogenous variables when error terms are
    shown. To hide the error terms, select &quot;Hide Error Terms&quot; from the Tools menu. </p>
<p>Note that using SEM graphs to construct SEMs is merely a convenience. Any SEM model you can build, you can build from
    a SEM graph, and all SEM graphs can be used to construct SEM models. However, DAGs can also be used to construct SEM
    models, and general graphs (see) can be used to construct SEM models, provided only directed and bidirected edges
    are used.</p>
<p>Once you have made a graph, you may rearrange the nodes by clicking and dragging; the edges will follow along so taht
    the structure of the graph remains the same. If you would like to move a whole section of nodes to another location,
    draw a &quot;rubberband&quot; around them and click on any one to move them. See <a
            href="../../common_tasks/selecting_groups_of_nodes.html">Selecting Groups of Nodes</a> for details. If you
    would like to change the name of a variable, or change whether the variable is latent or measured, double click the
    variable, edit its properties, and click &quot;OK.&quot; See <a
            href="../../graph/advise_editing_node_properties.html">Editing Node Properties</a> for details. </p>
<p>When you click &quot;Save,&quot; the graph editor window will close, and the contents will be saved in memory. If you
    click &quot;Cancel,&quot; the changes you made while editing will be disgarded, and the state of the graph before
    editing will remain unchanged. You may change the graph you made at any time by reopening the Graph box and adding
    or remove variables or edges or rearranging variables.</p>
<p>If you right click on the Graph box, a popup menu will appear with several options. See <a
        href="../../graph/popups.html">Popup Menus </a> for more detail.</p>
<p>&nbsp;</p>
<h3>Important Points</h3>
<ol>
    <li>If you create a model with a latent variable, if you later use the model to generate data, values for the latent
        variables will not be shown. See <a href="../../graph/measured_vs_latent.html">Measured Vs. Latent Variables</a>.
    </li>
    <li>If you have introduced any boxes that depend on a Graph box, changing the graph will alter the contents of all
        boxes downstream in the flowchart from the Graph box. Often it is easier to simply create a new Graph box in the
        same main workspace window--there is no limit to how many graph or other boxes you can have at the same time.
        See<a href="../../graph/advise_flowchart_dependencies.html"> Flowchart Dependencies</a>.
    </li>
</ol>
<p>&nbsp;</p>
<h3>Menus</h3>
<ol>
    <li>The menu at the top of the Graph window has two options, "File" and "Edit".&nbsp; "Edit" currently does nothing.
        "File" gives three options: You can save a graph in a file-- but there is no point because we have not yet
        implemented a facility to paste the saved graph into a new window. You can introduce the ALARM network,&nbsp; a
        fairly complex graph standardly used as a test for search algorithms, and you can save any graph you create as
        an image file that can be introduced into text documents, e.g., into Microsoft World.
    </li>
</ol>
<p>&nbsp;</p>
<h3><a name="possible_parents"></a>Possible Parents for &quot;SEM Graph&quot; </h3>
<p>A &quot;SEM Graph&quot; model can be self-standing, as described above. However, it can also be made a child of a
    number of other models of a variety of different box types. Usually what this does is to make a copy in the &quot;SEM
    Graph&quot; box of a preexisting graph in the parent model, which is often a convenient thing to be able to do. The
    following models all have graphs that, if they happen to be interpretable as SEM graphs, can be copied into a &quot;SEM
    Graph&quot; model:</p>
<ol>
    <li>All graph models.</li>
    <li>All search models.</li>
    <li>All parametric models.</li>
    <li>All instantiated models.</li>
    <li>All updater models.</li>
</ol>
<p>In certain special cases, making a &quot;SEM Graph &quot; model a child of another model has a specialized behavior.
    If you make a &quot;SEM Graph &quot; model a child of a Data box model, the effect is to create a graph with all of
    the variables in the data set but no edges, as illustrated below.</p>
<p><img height="534" src="../../images/dag_from_data.gif" width="537"></p>
</body>
</html>
